package com.zyk.scaffold.mq.rocket.business.order.controller;

import com.zyk.scaffold.mq.rocket.business.order.pojo.request.CreateOrderRequest;
import com.zyk.scaffold.mq.rocket.business.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("/create")
    public String create(@RequestBody CreateOrderRequest createOrderRequest) throws Exception {

        return orderService.createOrder(createOrderRequest) ? "下单成功!" : "下单失败!";
    }
}
